function postXmlHttp( submitUrl, callbackFunc ,loadFunc)
{
  var _xmlHttpRequestObj = null;

  if(window.createRequest)
  {
    try{
      _xmlHttpRequestObj=window.createRequest();
      _xmlHttpRequestObj.open('POST',submitUrl,true);
      _xmlHttpRequestObj.onreadystatechange=function(){
        postXmlHttpProcessPostChange(_xmlHttpRequestObj, callbackFunc ,loadFunc);
      }
      _xmlHttpRequestObj.send();
    }
    catch(ee){}
  }
  else if(window.ActiveXObject)
  {
    _xmlHttpRequestObj=new ActiveXObject("Microsoft.XMLHTTP");
    _xmlHttpRequestObj.open('POST',submitUrl,true);
    _xmlHttpRequestObj.onreadystatechange=function(){
        postXmlHttpProcessPostChange(_xmlHttpRequestObj, callbackFunc ,loadFunc);
      }
    _xmlHttpRequestObj.send();
  }
  else if(window.XMLHttpRequest)
  {
    _xmlHttpRequestObj=new XMLHttpRequest();
    _xmlHttpRequestObj.overrideMimeType('text/xml');
    _xmlHttpRequestObj.open('POST',submitUrl,true);
    _xmlHttpRequestObj.onreadystatechange=function(){
        postXmlHttpProcessPostChange(_xmlHttpRequestObj, callbackFunc ,loadFunc);
      }
    _xmlHttpRequestObj.send("");
  }
}

function postXmlHttpProcessPostChange(xmlHttpRequestObj, callbackFunc ,loadFunc)
{
  if( xmlHttpRequestObj.readyState==4 && xmlHttpRequestObj.status==200 )
  {
    callbackFunc(xmlHttpRequestObj);
  }
  if ( xmlHttpRequestObj.readyState==1 )
  {
    loadFunc(xmlHttpRequestObj);
  }
}

//去空格function trimStr(str)
{
	return str.replace(/(^\s*)|(\s*$)/g, "");
}
//定义非法字符
var ILLEGAL_PATTERN_TWO = "^[^\"'<?>\/!@#\$%\^\*()&]+$";
//非法字符 '%描述
var MSG_TWO = "\"<'>?/!@#$%&^*()";	
 
//检查非法字符function validateInput(obj) 
{	
	 var tagName = obj.getAttribute("tagName");
	 var required = obj.getAttribute("required");
	 var allowlength = obj.getAttribute("allowlength"); 
	 var value = obj.value;
	 if(value == ''&& required == "true")
	 {
	 	alert(tagName + "必须填写");
	 	return false;
	 }
	 else if(value == '')
	 {
	 	return true;
	 }
	 var exp = new RegExp(ILLEGAL_PATTERN_TWO);	
	 if (!exp.test(value))
	 {
	 	alert(tagName + "：包含非法字符（"+MSG_TWO+"）"); 
	  	return false;
	 }
	 if(!checkAscii(value))
	 {
	 	return false;
	 }
	 //校验长度
	 if(GetLen(value) > allowlength)
	 {
	 	alert(tagName + "允许的最大长度为【"+allowlength+"个英文字符】"); 
	  	return false;	  
	 }
	 return true;		
}	 

//获取长度
function GetLen(str) 
{ 
	 var len=0; 
	 for(var i=0;i<str.length;i++) 
	 { 
	  	char = str.charCodeAt(i); 
	   	if(!(char>255)) 
	   	{ 
	     	len = len + 1; 	  
	  	} 
	  	else 
	  	{ 
		    len = len + 2; 
		} 
	 } 
	 return len; 
}

//验证数字
function validateNumber(value)
{
	 if(value == '')
	 {
	 	return true;
	 }
	 var exp =new RegExp("^([0-9])*$");
   	 var isCorrect =  exp.test(value);
        if(!isCorrect)
	 {
		alert("请输入数字类型！");
		return false;
	 }     			    
  	 return true;           
}

//校验ascii小于32的字符function checkAscii(value)
{
   if(value == null || value == "")
   {
   		return true;
   }
   var temp = value;
   for(var i=0; i<value.length; i++)
   {
   	  if(temp.charCodeAt(0,1)<32)
   	  {
   	  	alert("不能输入字符"+temp.substring(0,1));
   	  	return false;
   	  }
      temp = temp.substring(1,value.length)
   }
   return true;
}
